package br.com.ecomanda.util;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class SecurityUtil {
	
	public static String md5(String plainTextPassword){
		try {
			MessageDigest digest = MessageDigest.getInstance( "MD5" );
			BigInteger hash = new BigInteger(1, digest.digest(plainTextPassword.getBytes()));
			return hash.toString(16);
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
			return null;
		}
	}

}
